# Contributor: Adam Jensen <adam@acj.sh>
# Maintainer: Adam Jensen <adam@acj.sh>
pkgname=dssim
pkgver=3.3.1
pkgrel=0
pkgdesc="Tool for image similarity comparison, simulating human perception"
url="https://kornel.ski/dssim"
# arm* / ppc64le: Tries to compile mozjpeg-sys with 'with_simd'
# s390x: incompatible with load_image crate
arch="all !s390x !ppc64le !armv7 !armhf"
license="AGPL-3.0-only"
makedepends="cargo cargo-auditable"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/kornelski/dssim/archive/$pkgver.tar.gz
	update-rust-libc.patch
	"

build() {
	cargo auditable build --release
}

check() {
	cargo test --release
}

package() {
	install -Dm755 "target/release/dssim" "$pkgdir/usr/bin/dssim"
}

sha512sums="
1f114575d4fdc0b580b01334266ba833aeaa1aff57a8c17c9773afda318793c88950662a3c15264a2b34e193089b7805017b1261ed13209097d4ebb043383f89  dssim-3.3.1.tar.gz
1f4bb39f238c90aae1fa42d51f11fd91134104765e2a8f550fa6d8bf85ce84ea439460f8eb44e5c995bdc36af4a9725b97537abf8838d208d5508dc0ba7f8450  update-rust-libc.patch
"
